<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 

class Block_Post_Filter_Abstract extends Core_Block {

	protected $_requestVar = null;
	
	protected $_appliedValues = array();
	
	public function apply() {
		return $this;
	}
	
	public function getItems() {
		return array();
	}
	
	public function getRequestVar() {
		return $this->_requestVar;
	}
	
	public function getClearValue() {
		return null;
	}
	
	public function getLayer() {
		return $this->getData('layer');
	}
	
	public function getAppliedValues() {
		return $this->_appliedValues;
	}
	
	public function valuesToString($arr) {
		return implode('_', $arr);
	}

	public function stringToValues($s) {
		return explode('_', $s);
	}
	
	public function getResetUrl() {
		$query = App::get();
		$query[$this->getRequestVar()] = $this->getClearValue();
		return App::url('*/*', array('_query' => $query));
	}
	
	public function getItemUrl($value) {
		$query = App::get();
		$query[$this->getRequestVar()] = $value;
		return App::url('*/*', array('_query' => $query));
	}
}